/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eng.scc.core.view;

import com.eng.scc.core.data.Login;

/**
 *
 * @author Rafael
 */
public class ApplicationContext
{
    private static ApplicationContext context = null;
    private Login activeLogin = null;
    
    private ApplicationContext()
    {
    }
    
    public static ApplicationContext getInstance()
    {
        if ( context == null )
        {
            context = new ApplicationContext();
        }
        
        return context;
    }
    
    public Login getActiveUser()
    {
        return activeLogin;
    }
    
    public void setActiveUser( Login u )
    {
//        try
//        {
//            activeLogin = DatabaseManagerService.getInstance().getUser( 1 ); 
//        }
//        catch ( Exception e )
//        {
//            ApplicationContext.getInstance().saveLog( e );
//        }
    }
    
    public void saveLog( Exception e )
    {
        //tratamento de erros
        e.printStackTrace();
    }
}
